<template>
  <div class="sub-category">
    <div class="sub-item" :key="index" v-for="(item, index) in subCategoryList">
      <a :href="item.link">
        <img :src="item.image" @load="imgLoad" alt="">
      </a>
      <p class="title">{{item.title}}</p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    subCategoryList: {
      type: Array,
      dafault() {
        return [];
      }
    }
  },
  methods: {
    imgLoad() {
      this.$emit('subImgLoad');
    }
  }
}
</script>

<style scoped>
.sub-category {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 10px;
}

.sub-item {
  width: 80px;
  height: 100px;
  margin-bottom: 5px;
  text-align: center;
}

.sub-item a {
  display: block;
}

.sub-item img {
  width: 65px;
}

.sub-item p {
  margin-top: 8px;
  font-size: 14px;
}
</style>